package com.hongmeng.teamwork.service.impl;

import com.hongmeng.teamwork.entity.dto.TeamworkTaskDto;
import com.hongmeng.teamwork.mapper.TeamworkTaskMapper;
import com.hongmeng.teamwork.entity.po.TeamworkTask;
import com.hongmeng.teamwork.service.ITeamworkTaskService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (HongmengTeamworkTask)表服务实现类
 *
 * @author makejava
 * @since 2023-11-16 10:21:50
 */
@Service("hongmengTeamworkTaskService")
public class ITeamworkTaskServiceImpl implements ITeamworkTaskService {
    @Resource
    private TeamworkTaskMapper teamworkTaskMapper;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public TeamworkTask queryById(Long id) {
        return this.teamworkTaskMapper.queryById(id);
    }

    @Override
    public List<TeamworkTask> queryByIdList(List<Long> idList, TeamworkTask teamworkTask) {
        return this.teamworkTaskMapper.queryByIdList(idList, teamworkTask);
    }

    /**
     * 分页查询
     *
     * @param teamworkTask 筛选条件
     * @return 查询结果
     */
    @Override
    public List<TeamworkTask> queryByCondition(TeamworkTask teamworkTask) {
        return this.teamworkTaskMapper.queryByCondition(teamworkTask);
    }

    /**
     * 新增数据
     *
     * @param teamworkTask 实例对象
     * @return 实例对象
     */
    @Override
    public boolean insert(TeamworkTask teamworkTask) {
        return this.teamworkTaskMapper.insert(teamworkTask) > 0;
    }

    /**
     * 修改数据
     *
     * @param teamworkTask 实例对象
     * @return 实例对象
     */
    @Override
    public boolean update(TeamworkTask teamworkTask) {
        return this.teamworkTaskMapper.update(teamworkTask) > 0;
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Long id) {
        return this.teamworkTaskMapper.deleteById(id) > 0;
    }

    @Override
    public Long count(TeamworkTask teamworkTask) {
        return this.teamworkTaskMapper.count(teamworkTask);
    }
}
